<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="t" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>

<h2>Create a New Account</h2>
<p>
    Use the form below to create a new account. 
</p>
<p>
    Passwords are required to be a minimum of 6 characters in length.
</p>

<script src="/resources/scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="/resources/scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>

<sf:form action="/register" method="POST" modelAttribute="user" ><div>
        <fieldset>
            <legend>Account Information</legend>

            <div class="editor-label">
                <label for="userName">User name</label>
            </div>
            <div class="editor-field">
                <sf:input path="userName" data-val="true" data-val-required="The User name field is required." id="userName" name="userName" type="text" value="" />
                <sf:errors path="userName" cssClass="error" />
                <span class="field-validation-valid" data-valmsg-for="userName" data-valmsg-replace="true"></span>
            </div>

            <div class="editor-label">
                <label for="email">Email address</label>
            </div>
            <div class="editor-field">
                <sf:input path="email" data-val="true" data-val-required="The Email address field is required." id="email" name="email" type="text" value="" />
                <sf:errors path="email" cssClass="error" />
                <span class="field-validation-valid" data-valmsg-for="email" data-valmsg-replace="true"></span>
            </div>

            <div class="editor-label">
                <label for="password">Password</label>
            </div>
            <div class="editor-field">
                <sf:input path="password" data-val="true" data-val-length="The Password must be at least 6 characters long." data-val-length-max="100" data-val-length-min="6" data-val-required="The Password field is required." id="password" name="password" type="password" />
                <sf:errors path="password" cssClass="error" />
                <span class="field-validation-valid" data-valmsg-for="password" data-valmsg-replace="true"></span>
            </div>

            <div class="editor-label">
                <label for="ConfirmPassword">Confirm password</label>
            </div>
            <div class="editor-field">
                <input data-val="true" data-val-equalto="The password and confirmation password do not match." data-val-equalto-other="*.password" id="ConfirmPassword" name="ConfirmPassword" type="password" />
                <span class="field-validation-valid" data-valmsg-for="ConfirmPassword" data-valmsg-replace="true"></span>
            </div>

            <p>
                <input type="submit" value="Register" />
            </p>
        </fieldset>
    </div>
</sf:form>